package com.myth.process;

public class YieldTest implements Runnable{
    //礼让
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"线程开始执行");
        Thread.yield();
        System.out.println(Thread.currentThread().getName()+"线程停止执行");

    }

    public static void main(String[] args) {
        YieldTest t = new YieldTest();

        new Thread(t,"a").start();
        new Thread(t,"b").start();
    }


}

